﻿using System.Windows.Forms;

namespace ruscehproj2
{
    public partial class bsh003 : Form
    {
        bool vkl1IsPressed = false;
        bool vkl2IsPressed = false;
        bool isActive = false;
        public bsh003()
        {
            InitializeComponent();
        }

        public bool getState()
        {
            return isActive;
        }

        private void bsh003_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape)
            {
                this.Hide();
            }
        }

        private void bsh003_Load(object sender, System.EventArgs e)
        {
            if (FormManager.hlp.helpEnabled())
            {
                if (FormManager.BSH002.getState())
                {
                    if (isActive)
                    {
                        FormManager.hlp.setHelpId("end");
                    }
                    else FormManager.hlp.setHelpId("vkl");
                    FormManager.hlp.hlpRefresh();
                }
                else
                {
                    FormManager.hlp.notSoFast();
                }



                FormManager.hlp.Show();
            }
            
        }

        private void vkl1_Click(object sender, System.EventArgs e)
        {
            if (FormManager.BSH002.getState())
            {
                vkl1IsPressed = true;
                if (vkl1IsPressed && vkl2IsPressed)
                {
                    isActive = true;
                    FormManager.hlp.setHelpId("end");
                    FormManager.hlp.hlpRefresh();

                }
            }
        }

        private void bsh003_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (isActive) FormManager.hlp.setHelpId("8");
            FormManager.hlp.Hide();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {

        }

        private void vkl2_Click(object sender, System.EventArgs e)
        {
            if (FormManager.BSH002.getState())
            {
                vkl2IsPressed = true;
                if (vkl1IsPressed && vkl2IsPressed)
                {
                    isActive = true;
                    FormManager.hlp.setHelpId("end");
                    FormManager.hlp.hlpRefresh();

                }
            }
        }
    }
}
